const util = require( 'util' );
const uuid = require( 'uuid' );

function genUid() {
    return uuid.v4().replace( /-/g, '' );
}

function stringIsBlank( str ) {
    return ( str === undefined ) || ( str === null ) || ( str === '' );
}

function join( str, delimiter ) {

    if ( !str ) {
        return '';
    }

    var strJoin = '';
    for ( var i = 0; i < str.length; i++ ) {
        if ( i === 0 ) {
            strJoin += str.charAt( i );
        } else {
            strJoin += ( delimiter + str.charAt( i ) );
        }
    }
    return strJoin;
}

exports.genUid = genUid;
exports.stringIsBlank = stringIsBlank;
exports.join = join;
